Skip to content

Fixes cleanup of append-only test tempfiles on macOS/BSD#9560

Merged
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom
Goddesen:fix-append-file-removal
Apr 4, 2026
Merged

Fixes cleanup of append-only test tempfiles on macOS/BSD#9560
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom
Goddesen:fix-append-file-removal

Conversation

@Goddesen
Copy link
Copy Markdown
Contributor

@Goddesen Goddesen commented Apr 4, 2026

Description

The test_extract_restores_append_flag test leaves append-only tempfiles around on macOS and FreeBSD that cannot be removed cleanly. This was previously just ignored by the cleanup func but those files occasionally caused lots of warning output on subsequent test runs. Fixed by attempting to clear flags and retry whenever the cleanup function fails.

I am not entirely sure what triggers the warnings, I can usually do a couple of test runs before the warnings start showing even though the files would have been left around after the first test run. Cleaning them up properly is the right thing to do anyway.

Checklist

  • PR is against master (or maintenance branch if only applicable there)
  • New code has tests and docs where appropriate
  • Tests pass (run tox or the relevant test subset)
  • Commit messages are clean and reference related issues

The `test_extract_restores_append_flag` test leaves append-only
tempfiles around on macOS and FreeBSD that cannot be removed cleanly,
this was previously just ignored by the cleanup func but those files
occasionally caused lots of warning output on subsequent test runs.
Fixed by attempting to clear flags and retry whenever the cleanup
function fails.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.36%. Comparing base (c8f8def) to head (354ca28).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/borg/conftest.py 55.55% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9560   +/-   ##
=======================================
  Coverage   83.36%   83.36%           
=======================================
  Files          87       87           
  Lines       15481    15489    +8     
  Branches     2325     2326    +1     
=======================================
+ Hits        12905    12912    +7     
- Misses       1822     1824    +2     
+ Partials      754      753    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann
Copy link
Copy Markdown
Member

Ah, good catch!

I already wondered why it does not clean up everything, but didn't debug it yet.

@ThomasWaldmann
Copy link
Copy Markdown
Member

BTW, the haiku test failure comes from setuptools_scm + its dependencies, just ignore it for now.

@Goddesen
Copy link
Copy Markdown
Contributor Author

Goddesen commented Apr 4, 2026

Codecov triggers on conftest.py? 🤔

Maybe that should be ignored or moved into the testsuite.

@ThomasWaldmann ThomasWaldmann merged commit cb2721d into borgbackup:master Apr 4, 2026
18 of 20 checks passed
@ThomasWaldmann
Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants